package com.ruoyi.marry.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.marry.domain.TMarryInfo;
import com.ruoyi.marry.mapper.TMarryInfoMapper;
import com.ruoyi.marry.service.ITMarryInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 婚礼邀请Service业务层处理
 *
 * @author user_marry
 * @date 2020-11-19
 */
@Service
public class TMarryInfoServiceImpl implements ITMarryInfoService {
    @Autowired
    private TMarryInfoMapper tMarryInfoMapper;

    /**
     * 查询婚礼邀请
     *
     * @param id 婚礼邀请ID
     * @return 婚礼邀请
     */
    @Override
    public TMarryInfo selectTMarryInfoById(Long id) {
        return tMarryInfoMapper.selectTMarryInfoById(id);
    }

    /**
     * 查询婚礼邀请列表
     *
     * @param tMarryInfo 婚礼邀请
     * @return 婚礼邀请
     */
    @Override
    public List<TMarryInfo> selectTMarryInfoList(TMarryInfo tMarryInfo) {
        return tMarryInfoMapper.selectTMarryInfoList(tMarryInfo);
    }

    /**
     * 查询婚礼邀请及恋人信息列表
     *
     * @return 婚礼邀请集合
     */
    @Override
    public List<TMarryInfo> selectTMarryInfoListAll() {
        return tMarryInfoMapper.selectTMarryInfoListAll();
    }

    /**
     * 新增婚礼邀请
     *
     * @param tMarryInfo 婚礼邀请
     * @return 结果
     */
    @Override
    public int insertTMarryInfo(TMarryInfo tMarryInfo) {
        tMarryInfo.setCreateTime(DateUtils.getNowDate());
        return tMarryInfoMapper.insertTMarryInfo(tMarryInfo);
    }

    /**
     * 修改婚礼邀请
     *
     * @param tMarryInfo 婚礼邀请
     * @return 结果
     */
    @Override
    public int updateTMarryInfo(TMarryInfo tMarryInfo) {
        tMarryInfo.setUpdateTime(DateUtils.getNowDate());
        return tMarryInfoMapper.updateTMarryInfo(tMarryInfo);
    }

    /**
     * 删除婚礼邀请对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTMarryInfoByIds(Long[] ids) {
        return tMarryInfoMapper.deleteTMarryInfoByIds(ids);
    }

    /**
     * 删除婚礼邀请信息
     *
     * @param id 婚礼邀请ID
     * @return 结果
     */
    @Override
    public int deleteTMarryInfoById(Long id) {
        return tMarryInfoMapper.deleteTMarryInfoById(id);
    }

}
